/**
 * localStorage:set
 * @param {String} key
 * @param {Object} value
 */
export function setLocal(key, value) {
  value = typeof value === 'string' ? value : JSON.stringify(value)
  window.localStorage.setItem(key, value)
}
export function getLocal(key) {
  try {
    return JSON.parse(window.localStorage.getItem(key))
  } catch (e) {
    return window.localStorage.getItem(key)
  }
}
/**
 * localStorage:remove
 * @param {String} key
 */
export function clearLocal(key) {
  window.localStorage.removeItem(key)
}
